/* 
 * File:   DataSet.h
 * Author: shadius
 *
 * Created on 11. listopad 2012, 15:29
 */

#ifndef DATASET_H
#define	DATASET_H
//TODO: REMOVE ME!!
#define COLUMN_COUNT 2
#define COLUMN_TIME 0
#define COLUMN_VALUE 1
#include "IFastDataApprox.h"
#include "TimeUtils.h"
#include <vector>

#include <memory>
//#include <boost/numeric/ublas/matrix.hpp>

using namespace std;

class DataSet : public IFastDataApprox {
public:
    DataSet(int x);
    void add(int x, double value);
    double get(int x, int y);
    DataSet(const DataSet& orig);
    virtual ~DataSet();
    HRESULT WINAPI AddBuf(LPAPPROXPOINT points, int len, int *added);
    HRESULT WINAPI GetBuf(LPAPPROXPOINT points, floattype step, int len, int *filled);
    HRESULT WINAPI EnumBuf(int *index, LPAPPROXPOINT points, int len, int *filled);
    HRESULT WINAPI GetPrecedingPoint(floattype x, int *index);
    HRESULT WINAPI Count(int *cnt);
    HRESULT WINAPI Clear(int start, int stop);
private:
    shared_ptr<vector<double>> p_vector;
    //shared_ptr<boost::numeric::ublas::matrix<double>> p_matrix;
        double approx(floattype step);
};

#endif	/* DATASET_H */

